package com.zdl.interestingapp.view;

import android.app.Application;
import android.content.Context;
import android.content.res.Resources;

import org.litepal.LitePal;
import org.litepal.LitePalApplication;

/**
 * @author zdl
 * @date 2018/4/25 10:41
 * email zdl328465042@163.com
 * description
 */
public class InterestingApplication extends LitePalApplication {
    private static InterestingApplication application;

    /**
     * 获取全局Context
     * @return context
     */
    public static Context getAppContext(){
        return application;
    }

    /**
     * 获取全局Resources
     * @return resources
     */
    public static Resources getAppResources(){
        return application.getResources();
    }

    @Override
    public void onCreate() {
        super.onCreate();

        init();
        initLitePal();
    }

    private void init() {
        application = this;
    }

    private void initLitePal() {
        LitePal.initialize(this);
    }
}
